<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <cpn></cpn>
</div>
<template id="cpn">
  <div>
    <h2>我是子组件</h2>
    <button @click="btnClick">点击</button>
  </div>
</template>
<script src="../../../project_practice/lunbotu/vue.js"></script>
<script>
  const app = new Vue({
    el:'#app',
    data:{
      message:"你好啊！！"
    },
    methods:{

    },
    components:{
      cpn:{
        template:'#cpn',
        methods: {
          btnClick(){
            //1.访问父组件$parent
            console.log(this.$parent);
          }
        }
      }
    }
  })
</script>
</body>
</html>